package c.c.a;

import android.content.Context;
import android.telephony.TelephonyManager;
import org.json.JSONObject;

public class p extends b2 {
    public final Context e;
    public final g2 f;

    public p(Context context, g2 g2Var) {
        super(true, false);
        this.e = context;
        this.f = g2Var;
    }

    public boolean b(JSONObject jSONObject) {
        TelephonyManager telephonyManager = (TelephonyManager) this.e.getSystemService("phone");
        if (telephonyManager != null) {
            try {
                String deviceId;
                c.b(jSONObject, "carrier", telephonyManager.getNetworkOperatorName());
                c.b(jSONObject, "mcc_mnc", telephonyManager.getNetworkOperator());
                if (this.f.b.isImeiEnable()) {
                    if (m0.b) {
                        m0.a("SensitiveUtils gDI c", null);
                    }
                    deviceId = telephonyManager.getDeviceId();
                } else {
                    g2 g2Var = this.f;
                    deviceId = g2Var.b.getAppImei() == null ? "" : g2Var.b.getAppImei();
                }
                c.b(jSONObject, "udid", deviceId);
                return true;
            } catch (Exception e) {
                m0.b(e);
            }
        }
        return false;
    }
}
